﻿<ribbon:RibbonWindow x:Class="Mari.SmartHotel.Shell.ShellView" 
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:clabui="http://Microsoft.Services.Clab/ui/2010/07"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:local="clr-namespace:Mari.SmartHotel.Shell"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
                     xmlns:sh="http://schemas.smarthotel.it/xaml/presentation"
                     Title="Hotel"
                     Width="1024"
                     Height="768"
                     MinWidth="1024"
                     MinHeight="768"
                     d:DataContext="{d:DesignInstance Type=local:ShellViewModel}"
                     WindowState="Maximized"
                     mc:Ignorable="d">
    <ribbon:RibbonWindow.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../StyleDictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </ribbon:RibbonWindow.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <ribbon:Ribbon>
            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu SmallImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/SmallIcon.png">
                    <ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon" ImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/LargeIcon.png" />
                </ribbon:RibbonApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>
            <ribbon:RibbonTab Header="Hotel">
                <ribbon:RibbonGroup Header="Clienti">
                    <ribbon:RibbonButton Command="{clabui:ActionCommand ActionName=LaunchFunction}" 
                                         CommandParameter="Modules.Foundation.Guests.SearchGuest"
                        Label="Ricerca" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/BusinessmanFind.png" />
                    <ribbon:RibbonButton Command="{clabui:ActionCommand ActionName=LaunchFunction}" 
                                         CommandParameter="Modules.Foundation.Guests.EditGuest"
                                         Label="Nuovo Cliente"
                                         LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/BusinessmanAdd.png">
                       
                    </ribbon:RibbonButton>
                    <ribbon:RibbonButton Label="Nuova Società" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/Factory.png" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="Soggiorno">
                    <ribbon:RibbonButton Label="Ricerca Soggiorno" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/Bed.png" />
                    <ribbon:RibbonButton Label="Nuovo Soggiorno" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/Bed.png" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="Ricevute">
                    <ribbon:RibbonButton Label="Ricerca Ricevuta" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/CashRegisterOpen.png" />
                    <ribbon:RibbonButton Label="Nuova Ricevuta" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/CashRegisterOpen.png" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="Stampe">
                    <ribbon:RibbonButton Label="Corrispettivi" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/DDCCPagamentoCedole.png" />
                    <ribbon:RibbonButton Label="Rilevazione movimento clienti" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/DDCCRistampa.png" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab Header="Utilità">
                <ribbon:RibbonGroup Header="Fornitori">
                    <ribbon:RibbonButton Label="Ricerca Fornitore" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/LargeIcon.png" />
                    <ribbon:RibbonButton Label="Nuova Fornitore" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/LargeIcon.png" />
                </ribbon:RibbonGroup>
                <ribbon:RibbonGroup Header="Varie">
                    <ribbon:RibbonButton Label="Ricerca Comune" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/LargeIcon.png" />
                    <ribbon:RibbonButton Label="Analisi numero progressivo" LargeImageSource="/Mari.SmartHotel.Controls;component/Resources/Ribbon/LargeIcon.png" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="0.30*" />
            </Grid.ColumnDefinitions>
            <Border Grid.Column="0" 
                    BorderBrush="Black"
                    BorderThickness="0.5"
                    CornerRadius="5"
                    Style="{StaticResource mainFrameStyle}">
                <Grid>
                    <TabControl Background="Transparent" 
                                IsSynchronizedWithCurrentItem="True"
                                ItemsSource="{Binding ChildControllers}"
                                SelectedItem="{Binding FocusedChildController}"
                                Visibility="Visible">
                        <TabControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Label Margin="0,0,5,0" Content="{Binding Path=ViewModel.Views.MainView.Title}" />
                                    <Button Command="{clabui:ActionCommand ActionName=TabClosing}" BorderThickness="0"
                                            CommandParameter="{Binding}" Padding="0">
                                        <Image Source="/Mari.SmartHotel.Controls;component/Resources/SHMessageBox/Error.png" Width="16"></Image>
                                    </Button>
                                </StackPanel>
                            </DataTemplate>
                        </TabControl.ItemTemplate>
                        <TabControl.ContentTemplate>
                            <DataTemplate>
                                <Viewbox StretchDirection="Both" Stretch="Uniform">
                                    <ContentControl Content="{Binding Path=ViewModel.Views.MainView}" />
                                </Viewbox>
                            </DataTemplate>
                        </TabControl.ContentTemplate>
                        <TabControl.Style>
                            <Style TargetType="{x:Type TabControl}">
                                <Setter Property="Visibility" Value="Visible" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=ChildControllers.Count}" Value="0">
                                        <Setter Property="Visibility" Value="Hidden" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TabControl.Style>
                    </TabControl>
                    <Viewbox>
                        <sh:MainPaneEmpty HorizontalAlignment="Center" VerticalAlignment="Center" />
                        <Viewbox.Style>
                            <Style TargetType="{x:Type Viewbox}">
                                <Setter Property="Visibility" Value="Hidden" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=ChildControllers.Count}" Value="0">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Viewbox.Style>
                    </Viewbox>
                </Grid>
            </Border>
            <Viewbox Grid.Column="1" 
                     Stretch="Fill"
                     StretchDirection="UpOnly">
                <Border Grid.Column="1" 
                        Width="230"
                        Height="567"
                        Style="{StaticResource rightPaneStyle}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.70*" />
                            <RowDefinition Height="3" />
                            <RowDefinition Height="0.30*" />
                        </Grid.RowDefinitions>
                        <GroupBox x:Name="taskPane" 
                                  Header="Operazioni"
                                  Style="{StaticResource RightPane}" />
                        <GridSplitter Grid.Row="1" 
                                      HorizontalAlignment="Stretch"
                                      Background="Transparent"
                                      Focusable="False"
                                      ResizeDirection="Rows" />
                        <GroupBox x:Name="helpPane" 
                                  Grid.Row="2"
                                  Header="Help"
                                  Style="{StaticResource RightPane}" />
                    </Grid>
                </Border>
            </Viewbox>
        </Grid>
        <StatusBar Grid.Row="2">
            <StatusBarItem Content="Test" />
        </StatusBar>
    </Grid>
</ribbon:RibbonWindow>